home *** CD-ROM | disk | FTP | other *** search
- /* strcat.c From page 274 of TC Bible Use strcat to concatenate
- (append) one string to another. */
-
-
- #include <stdio.h>
- #include <string.h>
- main()
- {
- char fullname[80], last[40], middle[10];
- printf("Enter your first name: ");
- gets(fullname);
- printf("Last name: ");
- gets(last);
- printf("Middle initial: ");
- gets(middle);
-
- /* Append the parts together to get full name */
-
- strcat(fullname, " ");
- strcat(fullname, middle);
- strcat(fullname, " ");
- strcat(fullname, last);
- printf("Greetings! %s\n", fullname);
- }